﻿/**********************************天使物流*******************************************
* 功能描述:系统设置——操作员管理
* 作者:孟帅龙
* 时间:2022/1/11
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.System;
using TianShiProject.Models.System.Operators;
using Volo.Abp.Application.Services;

namespace TianShiProject.System.Operators
{
    public class OperatorService : ApplicationService
    {
        public readonly IOperatorRepository _operatorRepository;
        public OperatorService(IOperatorRepository operatorRepository)
        {
            _operatorRepository = operatorRepository;
        }

        #region 操作员管理——查询分页显示
        /// <summary>
        /// 操作员管理——查询分页显示
        /// </summary>
        /// <param name="OperatorNumber"></param>
        /// <param name="OperatorName"></param>
        /// <param name="DeptId"></param>
        /// <param name="OperatorPhone"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<OperatorDto>> GetOperatorPageShow(string OperatorNumber, string OperatorName, int? DeptId, string OperatorPhone, int pageindex = 1, int pagesize = 3)
        {
            return await _operatorRepository.GetOperatorPageShow(OperatorNumber, OperatorName, DeptId, OperatorPhone, pageindex, pagesize);
        }
        #endregion

        #region 操作员管理——部门显示
        /// <summary>
        /// 操作员管理——部门显示
        /// </summary>
        /// <returns></returns>
        public async Task<List<DeptDto>> GetDepartment()
        {
            return await _operatorRepository.GetDepartment();
        }
        #endregion

        #region 操作员管理——逻辑删除
        /// <summary>
        /// 操作员管理——逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<PageResponse<OperatorDto>> DeleteOperator(int id)
        {
            return await _operatorRepository.DeleteOperator(id);
        }
        #endregion

        #region 操作员管理——角色显示
        /// <summary>
        /// 操作员管理——角色显示
        /// </summary>
        /// <returns></returns>
        public async Task<List<RoleDto>> GetRole()
        {
            return await _operatorRepository.GetRole();
        }
        #endregion

        #region 操作员管理——编辑
        /// <summary>
        /// 操作员管理——编辑
        /// </summary>
        /// <param name="operatorDto"></param>
        /// <returns></returns>
        public async Task<PageResponse<OperatorDto>> PutUpdateOperator(OperatorDto operatorDto)
        {
            return await _operatorRepository.PutUpdateOperator(operatorDto);
        }
        #endregion

        #region 操作员管理——批量删除
        /// <summary>
        /// 操作员管理——批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<PageResponse<OperatorDto>> DeleteBatchOperator(string ids)
        {
            return await _operatorRepository.DeleteBatchOperator(ids);
        }
        #endregion

        #region 操作员管理——添加
        /// <summary>
        /// 操作员管理——添加
        /// </summary>
        /// <param name="operatorDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddOperator(OperatorDto operatorDto)
        {
            return await _operatorRepository.PostAddOperator(operatorDto);
        } 
        #endregion
    }
}
